label: Pass <markup> length directly when parsing markup
authorTimm Bäder <mail@baedert.org>
Fri, 10 Apr 2020 14:29:32 +0000 (16:29 +0200)
committerTimm Bäder <mail@baedert.org>
Fri, 17 Apr 2020 13:21:00 +0000 (15:21 +0200)
gtk/gtklabel.c

index 5caf2ea1d0cbe11f7bc9e31f0658b27eb0b2121b..34d51677c8e6cc7ce503f5ac70e26c67b6257832 100644 (file)
@@ -2223,7 +2223,7 @@ parse_uri_markup (GtkLabel      *label,
                   guint         *out_n_links,
                   GError       **error)
 {
-  GMarkupParseContext *context = NULL;
+  GMarkupParseContext *context;
   const char *p, *end;
   gsize length;
   UriParserData pdata;
@@ -2249,13 +2249,13 @@ parse_uri_markup (GtkLabel      *label,
     }
   else
     {
-      if (!g_markup_parse_context_parse (context, "<markup>", -1, error))
+      if (!g_markup_parse_context_parse (context, "<markup>", 8, error))
         goto failed;
 
       if (!g_markup_parse_context_parse (context, str, length, error))
         goto failed;
 
-      if (!g_markup_parse_context_parse (context, "</markup>", -1, error))
+      if (!g_markup_parse_context_parse (context, "</markup>", 9, error))
         goto failed;
     }